<?php

function loadAllPhpFiles($directory) {
    if (is_dir($directory)) {
        $files = scandir($directory);
        foreach ($files as $file) {
            if ($file!= "." && $file!= "..") {
                $path = $directory. DIRECTORY_SEPARATOR. $file;
                if (is_dir($path)) {
                    // 如果是子目录，递归调用函数
                    loadAllPhpFiles($path);
                } elseif (pathinfo($path, PATHINFO_EXTENSION) == "php") {
                    // 如果是php文件，加载该文件
                    require_once $path;
                }
            }
        }
    }
}

$extendDirectory = '../extend/';
loadAllPhpFiles($extendDirectory);

require 'helper.php';
